import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    init: false,
    userData: { name: "" },
    userPower: { power: "" },
    login: false,
  },
  mutations: {
    init(state) {
      state.init = true;
    },
    userData(state, data) {
      state.userData = data;
    },
    userPower(state, power) {
      state.userPower = power;
    },
    toLogin(state, data) {
      state.login = data;
    },
  },
});
